package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.GroupsDao;
import com.vne.skyemart.model.Groups;
import com.vne.skyemart.service.GroupsService;

@Service("groupsService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class GroupsServiceImpl implements GroupsService{
	@Autowired
	private GroupsDao groupsDao;

	public GroupsDao getGroupsDao() {
		return groupsDao;
	}

	public void setGroupsDao(GroupsDao groupsDao) {
		this.groupsDao = groupsDao;
	}
	public GroupsServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addGroups(Groups groups) {
		groupsDao.save(groups);
	}

	@Override
	public List<Groups> listGroups() {
		return groupsDao.findAll();
	}
	
}
